return (Babl*)&space_db[i];
}
-const Babl *
-babl_chromaticities_make_space (const char *name,
- double wx, double wy,
- double rx, double ry,
- double gx, double gy,
- double bx, double by,
- const Babl *trc_red,
- const Babl *trc_green,
- const Babl *trc_blue,
- BablSpaceFlags flags)
+const Babl * babl_space_from_chromaticities (const char *name,
+ double wx, double wy,
+ double rx, double ry,
+ double gx, double gy,
+ double bx, double by,
+ const Babl *trc_red,
+ const Babl *trc_green,
+ const Babl *trc_blue,
+ BablSpaceFlags flags)
{
int i=0;
static BablSpace space;
babl_space_class_init (void)
{
#if 0
- babl_chromaticities_make_space ("sRGB",
+ babl_space_from_chromaticities ("sRGB",
0.3127, 0.3290, /* D65 */
0.6400, 0.3300,
0.3000, 0.6000,
0.1500, 0.0600,
babl_trc("sRGB"), NULL, NULL, 1);
#else
- babl_chromaticities_make_space ("sRGB",
+ babl_space_from_chromaticities ("sRGB",
0.3127, 0.3290, /* D65 */
0.639998686, 0.330010138,
0.300003784, 0.600003357,
/* hard-coded pre-quantized values - to match exactly what is used in standards see issue #18 */
#endif
- babl_chromaticities_make_space ("Rec2020",
+ babl_space_from_chromaticities ("Rec2020",
0.3127, 0.3290, /* D65 */
0.708, 0.292,
0.170, 0.797,
// XXX: is using sRGB TRC right?
babl_trc("sRGB"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"Adobish", /* a space that can be used as a place-holder for a sRGB like
space with displaced green coordinates from a big graphics software vendor that
would rather not it's name be directly used when referring to this color space,
0.1500, 0.0600,
babl_trc("2.2"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"ProPhoto",
0.34567, 0.3585, /* D50 */
0.7347, 0.2653,
0.0366, 0.0001,
babl_trc("1.8"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"Apple",
0.3127, 0.3290, /* D65 */
0.6250, 0.3400,
babl_trc("1.8"), NULL, NULL, 1);
#if 0
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"WideGamut",
0.34567, 0.3585, /* D50 */
0.7350, 0.2650,
0.1570, 0.0180,
babl_trc("2.2"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"Best",
0.34567, 0.3585, /* D50 */
0.7347, 0.2653,
0.1300, 0.0350,
babl_trc("2.2"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"Beta",
0.34567, 0.3585, /* D50 */
0.6888, 0.3112,
0.1265, 0.0352,
babl_trc("2.2"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"Bruce",
0.3127, 0.3290, /* D65 */
0.6400, 0.3300,
0.1500, 0.0600,
babl_trc("1.8"), NULL, NULL);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"PAL",
0.3127, 0.3290, /* D65 */
0.6400, 0.3300,
0.1500, 0.0600,
babl_trc("2.2"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"SMPTE-C",
0.3127, 0.3290, /* D65 */
0.6300, 0.3300,
0.1550, 0.0700,
babl_trc("2.2"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"ColorMatch",
0.34567, 0.3585, /* D50 */
0.6300, 0.3400,
0.1500, 0.0750,
babl_trc("1.8"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"Don RGB 4",
0.34567, 0.3585, /* D50 */
0.6960, 0.3000,
babl_trc("1.8"), NULL, NULL, 1);
#endif
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"ACEScg",
0.32168, 0.33767,
0.713, 0.293,
0.128, 0.044,
babl_trc("linear"), NULL, NULL, 1);
- babl_chromaticities_make_space (
+ babl_space_from_chromaticities (
"ACES2065-1",
0.32168, 0.33767,
0.7347, 0.2653,
} BablIccIntent;
/**
- * babl_icc_make_space:
+ * babl_space_from_icc:
*
* @icc_data: pointer to icc profile in memory
* @icc_length: length of icc profile in bytes
* containing a message describing why the provided data does not yield a babl
* space.
*/
+const Babl *babl_space_from_icc (const char *icc_data,
+ int icc_length,
+ BablIccIntent intent,
+ const char **error);
+
+// XXX : deprecated
const Babl *babl_icc_make_space (const char *icc_data,
int icc_length,
BablIccIntent intent,
BABL_SPACE_FLAG_EQUALIZE = 1
} BablSpaceFlags;
+// XXX: deprecated
+const Babl * babl_space_from_chromaticities (const char *name,
+ double wx, double wy,
+ double rx, double ry,
+ double gx, double gy,
+ double bx, double by,
+ const Babl *trc_red,
+ const Babl *trc_green,
+ const Babl *trc_blue,
+ BablSpaceFlags flags);
+
/**
- * babl_space_from_chromaticities:
+ * babl_space_from_chromaticities
*
* Creates a new babl-space/ RGB matrix color space definition with the
* specified CIE xy(Y) values for white point: wx, wy and primary
* Internally this does the math to derive the RGBXYZ matrix as used in an ICC
* profile.
*/
-const Babl * babl_chromaticities_make_space (const char *name,
- double wx, double wy,
- double rx, double ry,
- double gx, double gy,
- double bx, double by,
- const Babl *trc_red,
- const Babl *trc_green,
- const Babl *trc_blue,
- BablSpaceFlags flags);
+const Babl * babl_space_from_chromaticities (const char *name,
+ double wx, double wy,
+ double rx, double ry,
+ double gx, double gy,
+ double bx, double by,
+ const Babl *trc_red,
+ const Babl *trc_green,
+ const Babl *trc_blue,
+ BablSpaceFlags flags);
/**
*/
const char *babl_space_get_icc (const Babl *babl, int *length);
+/**
+ * babl_space_from_rgbxyz_matrix:
+ *
+ * Creates a new RGB matrix color space definition using a precomputed D50
+ * adapted 3x3 matrix and associated CIE XYZ whitepoint, as possibly read from
+ * an ICC profile.
+ */
+const Babl *
+babl_space_from_rgbxyz_matrix (const char *name,
+ double wx, double wy, double wz,
+ double rx, double gx, double bx,
+ double ry, double gy, double by,
+ double rz, double gz, double bz,
+ const Babl *trc_red,
+ const Babl *trc_green,
+ const Babl *trc_blue);
+
+
#ifdef __cplusplus
}
#endif